package com.example.springboot.mapper;

import com.example.springboot.controller.request.BaseRequest;
import com.example.springboot.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface UserMapper {

    //@Select("select * from user")
    List<User> list();


    List<User> listByCondition(BaseRequest baseRequest);

    void save (User user);

    User getById (Integer id);


    void updateById(User user);

    void deleteById (Integer id);


    void updateAccount (Integer id, Integer account);

    @Update("update user set account = #{account} where id = #{userId}")
    void updateUserAccount(Integer userId, Integer account);

}
